<template>
	<view class="xq">
		<view class="buttons">
			<view @click="toLsjl">历史记录</view>
		</view>
		<view class="info">
			<view class="info_item info_item_header">
				<view>主项目名称</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectName : ''}}</view>
			</view>
			<view class="info_item">
				<view>责任单位</view>
				<view>{{ xmglObj.project ? xmglObj.project.resDeptText : '' }}</view>
			</view>
			<view class="info_item">
				<view>计划投资总额</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectMoney : '' }}(万元)</view>
			</view>
			<view class="info_item">
				<view>初步选址</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectAddress : '' }}</view>
			</view>
			<view class="info_item">
				<view>分管领导</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectLeaderText : '' }}</view>
			</view>
			<view class="info_item">
				<view>项目分类</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectTypeText : '' }}</view>
			</view>
			<view class="info_item">
				<view>行业分类</view>
				<view>{{ xmglObj.project ? xmglObj.project.industryTypeText : '' }}</view>
			</view>
			<view class="info_item">
				<view>乡镇</view>
				<view>{{ xmglObj.project ? xmglObj.project.inTownshipText  : ''}}</view>
			</view>
			<view class="info_item">
				<view>经办人</view>
				<view>{{ xmglObj.project ? xmglObj.project.operateUser : '' }}</view>
			</view>
			<view class="info_item">
				<view>责任人</view>
				<view>{{ xmglObj.project ? xmglObj.project.resUser : '' }}</view>
			</view>
			<view class="info_item">
				<view>项目描述</view>
				<view>{{ xmglObj.project ? xmglObj.project.projectDescribes : '' }}</view>
			</view>
		</view>
		<view v-for="(item,index) in xmglObj.itemList" :key='index'>
			<view class="info">
				<view class="info_item info_item_header">
					<view>子项目详情</view>
					<view></view>
				</view>
				<view class="info_item">
					<view>创建时间</view>
					<view>{{ item.createTime }}</view>
				</view>
				<view class="info_item">
					<view>计划投资额</view>
					<view>{{ item.itemMoney }}(万元)</view>
				</view>
				<view class="info_item">
					<view>联系人</view>
					<view>{{ item.operateUserText }}</view>
				</view>
				<view class="info_item">
					<view>联系人手机号</view>
					<view>{{ item.operatorPhone }}</view>
				</view>
				<view class="info_item">
					<view>责任人</view>
					<view>{{ item.resUserText }}</view>
				</view>
				<view class="info_item">
					<view>责任人手机号</view>
					<view>{{ item.resUserPhone }}</view>
				</view>
				<view class="info_item">
					<view>分管领导</view>
					<view>{{ item.itemLeaderText }}</view>
				</view>
				<view class="info_item">
					<view>督查组</view>
					<view>{{ item.supervisionText === null ? '暂无数据' : item.supervisionText }}</view>
				</view>
				<view class="info_itemMore" v-for="(ite,ind) in item.mainProcessInf">
					<view class="info_itemMore_father">
						<view>{{ ite.mainProcessName }}</view>
					</view>
					<view class="info_itemMore_chirden" v-for="(it,ix) in ite.subProcessInf " @click="jump(it)">
						<view>{{it.subProcessName}}</view>
					</view>
				</view>
			</view>

			<view class="info" v-for="(dkitem,index) in item.relocateList">
				<view class="info_item info_item_header">
					<view>地块详情</view>
					<view></view>
				</view>
				<view class="info_item">
					<view>征迁名称</view>
					<view>{{ dkitem.relocateName }}</view>
				</view>
				<view class="info_item">
					<view>征迁类型</view>
					<view v-if="dkitem.relocateType === '1'">征地</view>
					<view v-if="dkitem.relocateType === '2'">拆迁</view>
					<view v-if="dkitem.relocateType === '3'">征地拆迁</view>
				</view>
				<view class="info_item">
					<view>乡镇</view>
					<view>{{ dkitem.townshipText }}</view>
				</view>
				<view class="info_item">
					<view>经办人</view>
					<view>{{ dkitem.relocateOperatorText }}</view>
				</view>
				<view class="info_item">
					<view>责任人</view>
					<view>{{ dkitem.relocateResUserText }}</view>
				</view>
				<view class="info_item">
					<view>征地面积</view>
					<view>{{ dkitem.relocateLandArea }}（亩）</view>
				</view>
				<view class="info_item">
					<view>拆迁面积</view>
					<view>{{ dkitem.relocateRemoveArea }}（m²）</view>
				</view>
				<view class="info_itemMore" v-for="(ite,ind) in dkitem.mainProcessInf">
					<view class="info_itemMore_father">
						<view>{{ ite.mainProcessName }}</view>
					</view>
					<view class="info_itemMore_chirden" v-for="(it,ix) in ite.subProcessInf " @click="jump(it,dkitem.relocateName)">
						<view>{{it.subProcessName}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		xmglDetail
	} from "@/request/zdxm.js"
	export default {
		data() {
			return {
				id: null,
				xmglObj: {},
			};
		},
		onReady() {},
		onLoad(option) {
			this.id = option.id
			this.xmglDetail()
		},
		methods: {
			xmglDetail() {
				xmglDetail({
						id: this.id
					})
					.then((res) => {
						this.xmglObj = res.data.result
						console.log('详情', res.data.result)
					})
			},
			jump(x,name) {
				if (x.subProcessType === '1') {
					uni.navigateTo({
						url: "/pages/zdxm/xmgl/jdxx/jdxx?id=" + x.id,
					});
				} else if (x.subProcessType === '2') {
					uni.navigateTo({
						url: "/pages/zdxm/xmgl/xq/xqlsjl?id=" + x.id + '&name=' + this.xmglObj.project
							.projectName + '&process=' + x.subProcessName,
					});
				} else {
					uni.navigateTo({
						url: "/pages/zdxm/xmgl/xq/zqjzlsjl?id=" + x.id + '&name=' + name
					});
				}
			},
			toLsjl() {
				console.log(this.xmglObj.project.id)
				uni.navigateTo({
					url: "/pages/zdxm/xmgl/xq/lsjl?id=" + this.xmglObj.project.id,
				});
			},
			toJdsb() {
				uni.navigateTo({
					url: "/pages/zdxm/xmgl/xq/xqjztb",
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.xq {
		padding-top: 24rpx;
		padding-bottom: 24rpx;
		padding-bottom: 120rpx;
		background-color: #f6f7fa;
		min-height: 100vh;

		.info {
			width: 710rpx;
			margin: 0 auto;
			background: #ffffff;
			box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(48, 116, 255, 0.1);
			border-radius: 8rpx;
			padding: 0 24rpx;
			margin-bottom: 20rpx;

			.info_itemMore {
				display: flex;
				flex-direction: column;
				// flex-flow: row nowrap;
				// justify-content: space-between;
				// align-items: center;
				padding: 16rpx 0;

				.info_itemMore_father {
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;

					view:nth-child(1) {
						width: 150rpx;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #8e9cb3;
						// border: 1rpx solid black;
					}
				}

				.info_itemMore_chirden {
					width: 100%;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #8e9cb3;
					padding-left: 10%;
					margin: 20rpx 0;
					text-decoration: underline;
				}

				.right_icon {
					width: 100%;
					display: flex;
					justify-content: flex-end;
				}

				.dqjd {
					color: #3074ff !important;
				}
			}

			.info_item {
				display: flex;
				flex-flow: row nowrap;
				justify-content: flex-start;
				align-items: flex-start;
				padding: 16rpx 0;

				view:nth-child(1) {
					width: 150rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #8e9cb3;
				}

				view:nth-child(2) {
					flex: 1;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #272b32;
					margin-left: 20rpx;
				}

				.dqjd {
					color: #3074ff !important;
				}
			}

			.info_item_header {
				height: 100rpx;
				line-height: 100rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #272b32;
				border-bottom: 1rpx solid rgba(231, 233, 240, 1);
				padding: 0;

				view:nth-child(2) {
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #272b32;
				}
			}
		}

		.buttons {
			width: 750rpx;
			height: 98rpx;
			line-height: 98rpx;
			text-align: center;
			display: flex;
			flex-flow: row nowrap;
			justify-content: flex-start;
			position: fixed;
			bottom: 0;
			left: 0;

			view {
				flex: 1;
			}

			view:nth-child(1) {
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #8e9cb3;
				background: #ffffff;
				border: 1px solid #e7e9f0;
			}

			view:nth-child(2) {
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #fefefe;
				background: #3074ff;
			}
		}
	}
</style>
